package com.hlhj.funlike_business.presenter;


import android.content.Context;

import com.example.mymvp.mvp.BasePresenter;
import com.hlhj.funlike_business.bean.FoodDetailBean;
import com.hlhj.funlike_business.bean.FoodTypeBean;
import com.hlhj.funlike_business.bean.UpImgBean;
import com.hlhj.funlike_business.moudle.AddCommentyMoudle;
import com.hlhj.funlike_business.views.AddCommentyView;

import java.io.File;
import java.util.List;


public class AddCommentyPresenter extends BasePresenter<AddCommentyMoudle,AddCommentyView> implements AddCommentyMoudle.getEidtFoodDetail {
    @Override
    public void createModule() {
        module = new AddCommentyMoudle();
        module.setListener(this);
    }

    public void LoadFoodDetail(Context context,int id){
        module.LoadFoodDetail(context,id);
    }

    public void LoadUpFoodImgResult(Context context,File image){
        module.LoadUpFoodImgResult(context,image);
    }

    public void LoadFoodType(Context context){
        module.LoadFoodType(context);
    }

    public void LoadEditFoodResult(Context context,int id,String goods_name,int type_id,String price,String details,
                                   int is_discount,String discount,int is_restrictions,int num,int is_sell,String photos,String attr){
        module.LoadEditFoodResult(context,id,goods_name,type_id,price,details,is_discount,discount,is_restrictions,num,is_sell,photos,attr);
    }

    public void LoadAddFood(Context context,String goods_name,int type_id,String price,String details,
                                   int is_discount,String discount,int is_restrictions,int num,int is_sell,String photos,String attr){
        module.LoadAddFood(context,goods_name,type_id,price,details,is_discount,discount,is_restrictions,num,is_sell,photos,attr);
    }
    @Override
    public void loadFoodDetai(FoodDetailBean.DataBean dataBean) {
        getView().showFoodDetai(dataBean);
    }

    @Override
    public void loadUpFoodImgResult(UpImgBean.DataBean dataBean) {
        getView().showUpFoodImgResult(dataBean);
    }

    @Override
    public void loadFoodType(List<FoodTypeBean.DataBean> dataBeans) {
        getView().showFoodType(dataBeans);
    }

    @Override
    public void loadEditFoodResult(String msg) {
        getView().showEditFoodResult(msg);
    }
}
